import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import FirstView from '../components/FirstView'
import SearchMusic from '../components/leftpart/SearchMusic'
import OrderMusic from '../components/leftpart/OrderMusic'
import NewSongs from '../components/leftpart/NewSongs'
import NewMv from '../components/leftpart/NewMv'
import playList from '../components/playList'
Vue.use(VueRouter)

// eslint-disable-next-line no-unused-vars
const routes = [
  { path: '/login', component: Login },
  { path: '/home', component: Home }
]

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    {
      path: '/home',
      component: Home,
      redirect: '/welcome',
      children: [
        { path: '/welcome', component: FirstView },
        { path: '/search', component: SearchMusic },
        { path: '/order', component: OrderMusic },
        { path: '/newsongs', component: NewSongs },
        { path: '/newmv', component: NewMv },
        { path: '/playlist', component: playList }
      ]
    }
  ]
})

export default router
